package com.cskaoyan.crud;

import com.cskaoyan.bean.Student;
import com.cskaoyan.mapper.StudentMapper;
import com.cskaoyan.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

/**
 * 创建日期: 2022/11/23 10:12
 *
 * @author ciggar
 */
public class DeleteDemo {

    public static void main(String[] args) {

        // 1. 获取SqlSession
        SqlSession sqlSession = MybatisUtils.getSqlSession();

        // 2. 获取接口的代理对象
        StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);

        int affectedRows = studentMapper.deleteStudentById(4001);

        System.out.println("affectedRows:" + affectedRows);

    }

}
